package com.lyy.photovoltaic.service.impl;

import com.lyy.photovoltaic.beans.UsersEquipmentsLists;
import com.lyy.photovoltaic.mapper.UsersEquipmentsListsMapper;
import com.lyy.photovoltaic.service.UserEquipmentsListsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.Arrays;
import java.util.List;

@Service
public class UserEquipmentsListsServiceImpl implements UserEquipmentsListsService {
    @Autowired
    UsersEquipmentsListsMapper usersEquipmentsListsMapper;
    @Override
    public List<String> ueIdList(String uId) {
        Example example = new Example(UsersEquipmentsLists.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("userId",uId);
        UsersEquipmentsLists usersEquipmentsLists1 = usersEquipmentsListsMapper.selectOneByExample(example);
//        System.out.println(usersEquipmentsLists1);
        String ueId = usersEquipmentsLists1.getUeId();
        List<String> list = Arrays.asList(ueId.split(","));
        return list;
    }
}
